//
//  MacroDefinition.h
//  JinXun
//
//  Created by Apple on 2021/8/12.
//

#ifndef MacroDefinition_h
#define MacroDefinition_h


//获取屏幕 宽度、高度
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

#define View_CornerRadius_small 5.0
#define View_CornerRadius_middle 10.0
#define View_CornerRadius_big 15.0

#define Space_small 5.0
#define Space_middle 10.0
#define Space_big 15.0

//获取系统版本
#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
#define CurrentSystemVersion [[UIDevice currentDevice] systemVersion]

//获取当前语言
#define CurrentLanguage ([[NSLocale preferredLanguages] objectAtIndex:0])

//检查系统版本
#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)


#define WeakObj(o) try{}@finally{} __weak typeof(o) o##Weak = o;
#define StrongObj(o) autoreleasepool{} __strong typeof(o) o = o##Weak;

#define WEAK( x ) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
__weak __typeof__(x) __weak_##x##__ = x; \
_Pragma("clang diagnostic pop")


#define STRONG( x ) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
if (__weak_##x##__ == nil) return;\
__typeof__(x) x = __weak_##x##__; \
_Pragma("clang diagnostic pop")


//MARK: - URL
/// 隐私政策
#define URL_private @"https://szc.klmhq.cn/jinxun/policy.html"
/// 用户服务协议
#define URL_userServiceAgreement @"https://szc.klmhq.cn/jinxun/service.html"

/// 维修保养
#define MaintenanceUrl @"http://seasaw.natapp1.cc/maintain.html"
/// 试驾
#define TestDriveUrl @"http://seasaw.natapp1.cc/trial.html"

//#define BaseUrl @"http://d2231e263b7c4a86.natapp.cc:1212"
#define BaseUrl @"https://seasawboms.natapp4.cc/KLM-APP/"
/// 获取用户信息
#define JXUrlPath_userInfo @"user/getUserInfo"
/// 退出登录
#define JXUrlPath_logout @"user/logout"
/// 保存用户信息
#define JXUrlPath_updateUserInfo @"user/updateUserInfo"
/// 保存头像
#define JXUrlPath_uploadFile @"user/uploadFile"
/// 获取验证码
#define JXUrlPath_authCode @"system/captcha"
/// 登陆
#define JXUrlPath_login @"system/login"
/// 获取品牌对应的 4s 店
#define JXUrlPath_getBrandCompany @"system/getBrandCompany"
/// 获取 所有车辆品牌
#define JXUrlPath_getAllBrand @"system/getAllBrand"

/// 首页 banner 图
#define JXUrlPath_banner @"app/queryIndexInformation"
/// 推荐 二手车 列表
#define JXUrlPath_SecondHandCar @"usedCar/queryRecommendCar"
/// 二手车 查询条件
#define JXUrlPath_SecondHandCar_QueryCondition @"usedCar/selectQueryConditionData"
/// 二手车 查询列表
#define JXUrlPath_SecondHandCar_QueryCarList @"usedCar/queryUsedCarList"
/// 二手车 详情
#define JXUrlPath_SecondHandCar_Detail @"usedCar/queryUsedCarDetail"

/// 精选 资讯
#define JXUrlPath__Choiceness_news @"/app/queryInformationList"


/// 会员 会员卡信息
#define JXUrlPath_MemberCard_CardInfo @"user/member/getMemberCard"
/// 会员 会员卡 关联车辆信息
#define JXUrlPath_MemberCard_RelationCar @"user/member/selectRelationCar"
/// 会员 会员卡 优惠券数量
#define JXUrlPath_MemberCard_couponNum @"user/member/selectCouponNum"
/// 会员 会员卡 优惠券信息
#define JXUrlPath_MemberCard_CouponInfo @"user/member/selectCouponData"



#define IMG_URL(url) [NSString stringWithFormat:@"%@%@",BaseUrl,url];


#define BaiDuMap_key @"a0YFOUeGkeSxIj2F32g7TpXXv76RBOWc"

#endif /* MacroDefinition_h */
